<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户注册</title>
</head>
<body>
<div><span>注册新用户:</span></div>
<hr>
<div>
    <form action="toregister_view" method="post">
        {% csrf_token %}
        <p><label>工号：</label><label><input name="employeeid"></label></p>
        <p><label>姓名：</label><label><input name="name"></label></p>
        <p><label>密码：</label><label><input name="password" type="password"></label></p>
        <button type="submit" id="btn1" disabled="False">注册</button>
    </form>
</div>

<form>
    用户名：<input type="text" name="user"></tr>
    密码：<input type="password" id="a"></tr>
    确认密码：<input type="password" id="b" onblur="check()">
    <button type="submit" id="btn2" disabled>提交</button>
</form>
<script type="text/javascript">
    function check() {
        var pwd1 = document.getElementById("a").value;
        var pwd2 = document.getElementById("b").value;
        if (pwd1 != pwd2)
            alert("您输入的两次密码不一致");
        else
            document.getElementById("btn2").disabled=false;
    }
</script>

</body>
</html>